package cn.mw.cmdb.service.impl;

import cn.mw.cmdb.service.CloudWisdomReportService;
import cn.mw.microMonitorCommon.api.cmdb.CloudWisdomReportSyncService;
import lombok.extern.slf4j.Slf4j;
import org.apache.dubbo.config.annotation.DubboService;
import org.springframework.beans.factory.annotation.Autowired;

import java.util.Arrays;

@DubboService
@Slf4j
public class CloudWisdomReportSyncServiceImpl implements CloudWisdomReportSyncService {

    @Autowired
    private CloudWisdomReportService cloudWisdomReportService;

    @Override
    public Boolean doReport(String ruleId) {
        try {
            cloudWisdomReportService.doReport(Arrays.asList(ruleId));
            return true;
        } catch (Exception e) {
            log.error("doReport error!", e);
            return false;
        }
    }
}
